package com.neo4j.neo4jDao;

import com.neo4j.node.DeptEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.neo4j.repository.Neo4jRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 类似于封装过的dao
 */
@Repository
public interface DeptRepository extends Neo4jRepository<DeptEntity,Long> {

    @Query("MATCH (d:Dept) WHERE d.deptName CONTAINS $title RETURN d ")
    List<DeptEntity> findByTitle(@Param("title") String title);

}
